<template>
    <tr>
        <th>||</th>
        <th>{{type}}</th>
        <th>{{num}}</th>
        <input v-model="newtro" :id="id" @input.lazy="changetro(id)">
        <th><button :id="id" @click="del(id)">删除</button></th>
    </tr>
</template>
<script>
    export default {
        name: 'mainList',
        props: ['type', 'id', 'tro', 'num'],
        data(){
            return {
                newtro :this.tro
            }
        },
        methods: {
            changetro(id){
                this.$emit('changetro',id,this.newtro)
            },
            del(ind){
                this.$emit('del',ind)
            }
        },
    }
</script>

<style scoped>
    tr {
        height: 40px;
        line-height: 40px;
    }
</style>